home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-03 / qbfaqr01.zip / FONTEST.BAS < prev    next >
BASIC Source File  |  1992-08-10  |  2KB  |  45 lines

  1. ' FONTEST.BAS
  2. '
  3. '   Author:     Christy Gemmell
  4. '   For:        Roy Olsen
  5. '   Date:       4/5/1992
  6. '
  7. '   $DYNAMIC
  8. '
  9. '   $INCLUDE: 'QBX.BI'
  10. '
  11.     DIM InRegs AS RegTypeX, OutRegs AS RegTypeX
  12.     DIM Block AS STRING * 16            ' To hold the new definition table
  13.  
  14.     LSET Block = STRING$(16, 255)       ' Light up 8 * 16 pixels
  15.  
  16.     InRegs.ax = &H1100                  ' Load user font
  17.     InRegs.bx = &H1000                  ' AH = bytes per character
  18.     InRegs.cx = 1                       ' Number of characters to change
  19.     InRegs.dx = 156                     ' ASCII code of char to start at
  20.     InRegs.es = VARSEG(Block)           ' Segment of definition table
  21.     InRegs.bp = VARPTR(Block)           ' Offset of definition table.
  22.     INTERRUPTX &H10, InRegs, OutRegs    ' Call Video BIOS
  23.  
  24.     CLS : LOCATE 10, 1
  25.     FOR I% = 128 TO 255
  26.         PRINT CHR$(I%);
  27.     NEXT I%
  28. END
  29.  
  30. 'You must be careful to specify the correct number of bytes per
  31. 'character for the video adaptor being used. For VGA the number
  32. 'is 16 as used above, but EGA cards only use 14 bytes to define
  33. 'an individual character. Fortunately you don't have to worry
  34. 'about resetting the original character set, since QuickBASIC
  35. 'does this for you automatically when a program ends. It also
  36. 'does this if you switch screen modes, so be warned.
  37.  
  38. 'I'll leave it to you to design your own characters. If you need
  39. 'to see how the existing character set is organised then you can
  40. 'find the address of it's definition table by reading the contents
  41. 'of interrupt vector 1Fh in low RAM. These four bytes at address
  42. '0000:007C contain a pointer to the character definition table
  43. 'for the high ASCII characters 128-255. These are in your video
  44. 'card's ROM, however, so you can't alter them directly.
  45.